% File mathematica.sty -- TeX versions are mathematica{12,10}pt.tex
% Macros for TeX/Mathematica documents
% Written 2/11/1991 by Dan Dill dan@chem.bu.edu
% 2/28/1991 changed for LaTeX 2 may 90 or later.  See comment below

% Copyright (C) 1991 Dan Dill
% This is part of TeX/Mathematica
%
% TeX/Mathematica is distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility to
% anyone for the consequences of using it or for whether it serves any
% particular purpose or works at all, unless he says so in writing.
%
% Everyone is granted permission to copy, modify and redistribute this
% file, provided:
%  1.  All copies contain this copyright notice.
%  2.  All modified copies shall carry a prominant notice stating who
%      made the last modification and the date of such modification.
%  3.  No charge is made for this software or works derived from it.  
%      This clause shall not be construed as constraining other software
%      distributed on the same medium as this software, nor is a
%      distribution fee considered a charge.
%
% The right to distribute this file for profit or as part of any commercial
% product is specifically reserved for the author.



%	\begin{mathematica}
%	...
%	\end{mathematica}
%
%  will indent enclosed text by dimension \@mmaindent (e.g. 2\parindent) from
%  current leftmargin.  Set with
%
%	\mmaindent{...}	% Default is \parindent
%
%  Verbatim text set in \@mmasize, set with
%
%	\mmasize{...}	% Default is \footnotesize
%
%  in fixed-width \tt font, The macro turns blanks into
%  spaces, starts a new line for each carrige return (or sequence of 
%  consecutive carriage returns), and interprets EVERY character literally.
%  I.e., all special characters \, {, $, etc. are \catcode'd to 'other'.
%
%  Tab characters are expanded to eight character stops.
%
%  These macros work by trapping \begin{mathematica}.  This was done so
%  that tabs could be expanded.  I didn't see how to expand tabs easily
%  using LaTeX verbatim (trivlist).

% Fonts and sizes
\gdef\mm@size{\footnotesize}
\def\v@rbsize{\mm@size\tt} % Font for cell text

\newbox\t@bbox \setbox\t@bbox=\hbox{\v@rbsize\ }
\newdimen\w \w=8\wd\t@bbox% tab amount

% \t@bbox and \w are reset if mmasize is changed
\def\mmasize#1{\gdef\mm@size{#1}
    \setbox\t@bbox=\hbox{\v@rbsize\ }
    \w=8\wd\t@bbox}


%\def\b@xfont{\scriptsize\tt} % Font for cell start indicator box
% One size works well for both 10 pt and 12 pt
\font\b@xtt=cmtt8
\def\b@xfont{\b@xtt} % Font for cell start indicator box

% Trap \begin{mathematica}
% \begin{mathematica}
\def\@mmatok{mathematica}
\def\begin#1{\def\testtok{#1}
	\ifx\testtok\@mmatok
		\let\next = \@mma
	\else%
		% This is LaTeX \def\begin#1...		
		\@ifundefined{#1}
			{\def\@tempa{\@latexerr{Environment #1 undefined}\@eha}}
% For LaTeX of 2 May 90 or later, replace the following line with the next two
%			{\def\@currenvir{#1}\def\@tempa{\csname #1\endcsname}}
			{\def\@tempa{\def\@currenvir{#1}\csname #1\endcsname}}
		\global\@ignoretrue %% \global... added 2 May 90
		\let\next = \@latexbegin%
	\fi
	\next}
\def\@latexbegin{\begingroup\@endpefalse\@tempa}

\input mathematica
